home *** CD-ROM | disk | FTP | other *** search
-
- { HERC.PAS - (c) 1990 TommySoftware
-
- A sample program used for displaying prictures exported from
- MegaPaint PC with the command "Export bitimage-Hercules"
-
- Notes:
- - You must have a Borland's Turbo-Pascal to compile this program.
- - There should be a file called HERC.BGI supplied by Borland
- in the current directory when you run this program.
- - Program is called with one parameter which is the full name
- of the 32k file exported from MegaPaint PC with the command
- "Export bitimage-Hercules"
-
- }
-
-
- program HERC;
-
- uses CRT, GRAPH;
-
- type screenblock = array[0..32767]of byte;
-
- var grdriver, grmode, err : integer;
- f : file of screenblock;
- screen : screenblock absolute $B000:$0000;
- ch : char;
-
-
- begin
-
- if paramcount < 1 then begin
- writeln('Filename required.');
- halt(1);
- end;
-
- grdriver := DETECT;
- initgraph(grdriver,grmode,'');
- err := graphresult;
- if err <> grOk then begin
- writeln('ERROR: ', grapherrormsg(err));
- halt(2);
- end;
- if grdriver <> HERCMONO then begin
- closegraph;
- writeln('You must have a hercules graphic adapter to run this program.');
- halt(3);
- end;
-
- assign(f, paramstr(1));
- {$I-}
- reset(f);
- {$I+}
- if ioresult <> 0 then begin
- closegraph;
- writeln('File "',paramstr(1),'" not found.');
- halt(4);
- end;
-
- read(f, screen);
-
- close(f);
- ch := readkey;
- closegraph;
-
- end.